# import functools
# import logging

# from common import CONSTANTS
# logger = logging.getLogger(CONSTANTS.TestCase.LOGGER_NAME)
'''
注意: pytest内部改造了装饰器，使用一般的带参数的函数装饰器或类装饰器均无法正常运行
'''

# def log_exceptions(_cls):
#     class WrappedClass(_cls):
#         def __getattribute__(self, item):
#             method = super().__getattribute__(item)
#             if callable(method):
#                 @functools.wraps(method)
#                 def wrapped_method(*args, **kwargs):
#                     try:
#                         result = method(*args, **kwargs)
#                     except Exception as e:
#                         logger.error(f"Exception in {method.__name__}: {e}")
#                         logger.exception(f"Stack trace for {method.__name__}")
#                         raise
#                     return result
#                 return wrapped_method
#             else:
#                 return method
#     return WrappedClass
